<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function login(){
        $username = $_GET['name'];
        $password = $_GET['password'];
        $info = D('User')->where(array('account'=>$username))->find();
        if($info){
            if($info['password'] == $password){
                $data['code'] = '1';
                $data['msg'] = '登录成功';
            }else{
                $data['code'] = '-1';
                $data['msg'] = '密码错误';
            }
        }else{
            $data['code'] = '-2';
            $data['msg'] = '用户不存在';
        }
        echo json_encode($data);
    }
<<<<<<< HEAD

=======
    public function check(){
        $code = $_GET['code'];
        $tel = $_GET['tel'];
        Vendor('Message.ChuanglanSmsApi');
        $clapi  = new \ChuanglanSmsApi();
        $result = $clapi->sendSMS('18908689198', '【253云通讯】您好，您的验证码是888888');
        $result = $clapi->execResult($result);
    }
    public function index(){
        echo 'Hello Word!';
    }
>>>>>>> da997656df4f2615f99411a65fe798571ce31e94

}